package com.steven.ourcontest.contest.api

import com.steven.ourcontest.contest.bean.MatchInfoRes
import com.steven.ourcontest.net.BaseResponse
import com.steven.ourcontest.net.EmptyResponse
import com.steven.ourcontest.team.bean.MatchInfo
import com.steven.ourcontest.team.bean.TeamInfoRes
import io.reactivex.Observable
import retrofit2.http.*

interface ContestApiService {

    @POST("/match/query")
    fun queryMatch(): Observable<BaseResponse<MatchInfoRes>>

    @FormUrlEncoded
    @POST("/match/detail")
    fun searchMatchDetailById(@Field("id") id: Long): Observable<BaseResponse<MatchInfoRes>>

    @FormUrlEncoded
    @POST("/match/addHistory")
    fun addHistory(@Field("matchId") matchId: Long): Observable<BaseResponse<EmptyResponse>>

    @FormUrlEncoded
    @POST("/match/searchTeam")
    fun searchTeamByMatch(@Field("matchId") matchId: Long): Observable<BaseResponse<TeamInfoRes>>

    @POST("/match/searchHistory")
    fun searchHistory(): Observable<BaseResponse<MatchInfoRes>>

    @POST("/match/searchHot")
    fun searchTop10MatchRecent(): Observable<BaseResponse<MatchInfoRes>>

    @POST("/match/add")
    fun addMatch(@Body matchInfo: MatchInfo): Observable<BaseResponse<EmptyResponse>>
}